<html>

<head>
    <script src="https://cdn.socket.io/4.3.2/socket.io.min.js"
        integrity="sha384-KAZ4DtjNhLChOB/hxXuKqhMLYvx3b5MlT55xPEiNmREKRzeEm+RVPlTnAn0ajQNs"
        crossorigin="anonymous"></script>
    <script>
        const socket = io('ws://localhost:3002');
        socket.on('connect', function () {
            console.log('Connected');

            socket.emit('findAllWebsocket', response =>
                console.log('findAllAaa', response),
            );

            socket.emit('findOneWebsocket', 1, response =>
                console.log('findOneAaa', response),
            );

            socket.emit('createWebsocket', { name: 'guang' }, response =>
                console.log('createAaa', response),
            );

            socket.emit('updateWebsocket', { id: 2, name: 'dong' }, response =>
                console.log('updateAaa', response),
            );

            socket.emit('removeWebsocket', 2, response =>
                console.log('removeAaa', response),
            );

        });
        socket.on('disconnect', function () {
            console.log('Disconnected');
        });

        socket.on('guang', function (data) {
            console.log('guang', data);
        });

    </script>
</head>

<body></body>

</html>